﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace TestCase_1
{
    class clsXMLController
    {
        public static void NewXMl()
        { 
            XmlTextWriter writer = new XmlTextWriter("data.xml", null);
 
            //  Set indenting so that its easier to read XML when open in Notepad and such apps.
            writer.Formatting = Formatting.Indented;
 
            //  This will output the XML declaration
            writer.WriteStartDocument();
 
                 //  Now let's add root element.
                writer.WriteStartElement("setting");
 
                    writer.WriteElementString("location","Ho Chi Minh");
                    writer.WriteElementString("update_time", "5");
                    writer.WriteElementString("collection", "Tick");
                    writer.WriteElementString("start_up", "true");
                    
                //  Close "setting" root element
                writer.WriteEndElement();
 
            writer.WriteEndDocument();

            writer.Flush();
            writer.Close();
             
        }
 
    }
}
